package view.inventory
{
import flash.geom.Point;

import framework.core.ComponentBuilder;

import values.avatar.AvatarTypeValue;
import values.avatar.IAvatarValue;
import values.item.EquipmentItemValue;

import view.component.window.WindowComponent;

/**
 * EquipmentSelectionUI
 * @author jliang
 *
 */
public class EquipmentSelectionUI extends WindowComponent
{
	//==========================================================================
	//  Class constants
	//==========================================================================
	public static function showEquipment(avatar:IAvatarValue, equipment:EquipmentItemValue):EquipmentSelectionUI
	{
		var ui:EquipmentSelectionUI = ComponentBuilder.create(EquipmentSelectionUI);
		ui.showEquipment(avatar, equipment);
		return ui;
	}
	
	public static function showEquipmentByPosition(avatar:IAvatarValue, position:String):EquipmentSelectionUI
	{
		var ui:EquipmentSelectionUI = ComponentBuilder.create(EquipmentSelectionUI);
		ui.showEquipmentByPosition(avatar, position);
		return ui;
	}
	//==========================================================================
	//  Constructor
	//==========================================================================
	public function EquipmentSelectionUI()
	{
		super();
	}	
	//==========================================================================
	//  Overridden methods: Component
	//==========================================================================
	override protected function get skinReference():String
	{
		return "swf.ui.EquipmentSelectionUISkin";
	}
	
	override protected function get proxyMapping():Array
	{
		return [ 
			{ skin:"", classRef: EquipmentSelectionUIProxy, id:"window" }
		];
	}
	
	public function showEquipment(avatar:IAvatarValue, equipment:EquipmentItemValue):void
	{
		EquipmentSelectionUIProxy(window).showEquipment(avatar, equipment);
		
		show();
	}
	
	public function showEquipmentByPosition(avatar:IAvatarValue, position:String):void
	{
		EquipmentSelectionUIProxy(window).showEquipmentByPosition(avatar, position);
		
		show();
	}
	
	override public function get width():Number
	{
		return 319;
	}
	
	override public function get height():Number
	{
		return 325;
	}
}
}


